<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>相对定位/绝对定位</title>
	<style type="text/css">
		div{
			width: 200px;
			height: 200px;
			float: left;
			color: #fff;
			font-size: 30px;
		}

		.box1{
			background: red url() 0 0 no-repeat;
		}

		.box2{
			background: blue url() 0 0 no-repeat;
			position: relative;
			top: 120px;
			left: -100px;
		}
		/*参照物是自己，原空间位不变*/

		.box3{
			background: green url() 0 0 no-repeat;
			position: absolute;
			top:50px;
			left: 50px;
		}
		.out{
			margin-top:100px;
			width: 100%;
			position: relative;
		}

		.box4{
			background: yellow url() 0 0 no-repeat;
			position: absolute;
			top: 0px;
			left: 30px;
			z-index: -1;
		}




	</style>
</head>
<body>
	<div class="out">
		<div class="box1">1</div>
		<div class="box2">2</div>
		<div class="box3">3</div>
		<div class="box4">4</div>
	</div>
</body>
</html>